echo.init({
    offset: 0,
    throttle: 3000,
});
var arr = ["yunqian", "yunzhong", "chanqian"]
var Datas = null;

$('.box').on("click", "a", function (e) {
    $.ajax({
        url: "data/data.json",
        dataType: "json",
        type: "get",
        success: function (data) {
            Datas = data;
        }
    })
    e.preventDefault();
    var HH = $(this).attr('href');
    var id = $(this).attr('id');
    $(HH).css({
        "transition": "all .2s",
        left: 0
    }).siblings().css({
        left: "100%"
    })

    if (e.target.parentNode.nodeName == "FOOTER") {

        // 尾部动画 
        var index = $(this).index();
        $('mark').animate({
            left: index * 25 + "%"
        })
    }
    if (HH == "#list") {
        getId(id)
    }
    inTo($(this))
})




// 判断有没有 id
function getId(id) {
    if ($.inArray(id, arr) > -1) {
        getLoad(id)
    }
}
// 渲染 数据
function getLoad(id) {
    console.log(Datas[id]['fenlei'])

}
new IScroll(".home", {
    click: true
});
function inTo(that) {
    var tt = that.attr('href');
    if (tt = "#list") {
        $(".leftr").show()
        $(".leftr").attr('href', '#home')
    } else if (tt = "#home") {
        $(".leftr").hide()
    }
}